<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="format-detection" content="telephone = no" />
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
    <title>我的简历</title>
    <link rel="stylesheet" type="text/css" href="../css/api.css" />
    <style>
        html,
        body {
            font-size: 14px;
            height: 100%;
            background-color: #f2f2f2;
        }

        header {
            position: fixed;
            top: 0;
            width: 100%;
            height: 75px;
            text-align: left;
            background-color: #fff;
            border-bottom: 1px solid #f2f2f2;
        }

        header .back {
            position: relative;
            margin-top: 38px;
            width: 100%;
            height: 1.5rem;
            text-align: center;
        }

        .back img {
            position: absolute;
            left: 1rem;
            width: 1.5rem;
            height: 1.5rem;
            vertical-align: middle;
        }

        main {
            padding-top: 75px;
        }

        .notice {
            padding: 1.5rem 0;
            color: #993333;
            font-weight: bold;
            text-align: center;
            background: url(../image/jianlibg.jpg)no-repeat;
            background-size: cover;
        }

        .myinfo {
            margin-top: 1rem;
        }

        .myinfo-title {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 1rem;
            margin-bottom: 1rem;
        }

        .myinfo-title span:nth-child(1) {
            color: #FFBF78;
            font-size: 1.2rem;
            font-weight: bolder;
        }

        .myinfo-title #edit {
            color: #fff;
            padding: 0.25rem 0.5rem;
            box-sizing: border-box;
            border-radius: 0.5rem;
            background-color: #FEA82F;
        }

        .myinfo-list {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 1rem;
            box-sizing: border-box;
            border-bottom: 1px solid #f2f2f2;
            background-color: #fff;
        }

        .myinfo-list span:nth-child(2) {
            color: #666;
        }

        .myinfo-list div img {
            width: 1.5rem;
            height: 1.5rem;
            vertical-align: middle;
            margin-right: 0.5rem;
        }
    </style>
</head>

<body>
    <header>
        <div class="back">
            <img src="../image/icon/back.png" alt="" onclick="api.closeWin()">
            <span>我的简历</span>
        </div>
    </header>
    <main>
        <div class="notice">完善简历可以提高录取率哟</div>
        <div class="myinfo">
            <div class="myinfo-title">
                <span>个人信息</span>
                <span id="edit" onclick="toedit()">修改</span>
            </div>

        </div>
    </main>
</body>
<script type="text/template" id="myinfo">
    {{~it.items:value:index}}
    <div class="infobox">
        <div class="myinfo-list">
            <div>
                <img src="../image/icon/name.png" alt="">
                <span>用户名</span>
            </div>
            {{? value.username == ''}}
            <span>无</span> {{??}}
            <span>{{=value.username}}</span> {{?}}
        </div>
        <div class="myinfo-list">
            <div>
                <img src="../image/icon/sex.png" alt="">
                <span>性别</span>
            </div>
            {{? !value.sex}}
            <span>无</span> {{??}}
            <span>{{=value.sex}}</span> {{?}}
        </div>
        <div class="myinfo-list">
            <div>
                <img src="../image/icon/age.png" alt="">
                <span>年龄</span>
            </div>
            {{? !value.age}}
            <span>无</span> {{??}}
            <span>{{=value.age}}</span> {{?}}
        </div>
        <div class="myinfo-list">
            <div>
                <img src="../image/icon/gznx.png" alt="">
                <span>工作年限</span>
            </div>
            {{? !value.worktime}}
            <span>无</span> {{??}}
            <span>{{=value.worktime}}</span> {{?}}
        </div>
        <div class="myinfo-list">
            <div>
                <img src="../image/icon/wx.png" alt="">
                <span>微信</span>
            </div>
            {{? !value.wechat}}
            <span>无</span> {{??}}
            <span>{{=value.wechat}}</span> {{?}}
        </div>
        <div class="myinfo-list">
            <div>
                <img src="../image/icon/qq.png" alt="">
                <span>QQ</span>
            </div>
            {{? !value.qq}}
            <span>无</span> {{??}}
            <span>{{=value.qq}}</span> {{?}}
        </div>
        <div class="myinfo-list">
            <div>
                <img src="../image/icon/phone.png" alt="">
                <span>手机号</span>
            </div>
            {{? !value.phone}}
            <span>无</span> {{??}}
            <span>{{=value.phone}}</span> {{?}}
        </div>
        <div class="myinfo-list">
            <div>
                <img src="../image/icon/status.png" alt="">
                <span>求职状态</span>
            </div>
            {{? !value.workstatus}}
            <span>无</span> {{??}}
            <span>{{=value.workstatus}}</span> {{?}}
        </div>
    </div>
    {{~}}
</script>
<script type="text/javascript" src="../script/api.js"></script>
<script src="../script/jquery-1.11.3.min.js" charset="utf-8"></script>
<script src="../script/doT.min.js" charset="utf-8"></script>
<script type="text/javascript">
    apiready = function() {
        getUserInfo();
    };

    function getUserInfo() {
        api.ajax({
            url: 'http://122.112.138.133/wangt/jianzhi/queryUserInfo.com',
            method: 'post',
            data: {
                body: {
                    "tbname": "userinfo",
                    "id": $api.getStorage('userid')
                }
            }
        }, function(ret, err) {
            if (ret) {
                $('.myinfo').append(parttime_render('myinfo', [ret.data]));
            }
        });

    };

    function toedit() {
        api.openWin({
            name: 'changeresume',
            url: './changeresume.html',
            slidBackEnabled: false
        });
    }

    function parttime_render(id, elements, options) {
        var options = options || {};
        var elementObj = doT.template($api.byId(id).innerHTML);
        var elementData = $.extend({
            items: elements
        }, options);
        return elementObj(elementData);
    }
</script>

</html>
